import 'package:tender_flutter/page/home/model/company_dynamic_entity.dart';

companyDynamicEntityFromJson(CompanyDynamicEntity data, Map<String, dynamic> json) {
	if (json['content'] != null) {
		data.content = new List<CompanyDynamicContentEntity>();
		(json['content'] as List).forEach((v) {
			data.content.add(new CompanyDynamicContentEntity().fromJson(v));
		});
	}
	return data;
}

Map<String, dynamic> companyDynamicEntityToJson(CompanyDynamicEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	if (entity.content != null) {
		data['content'] =  entity.content.map((v) => v.toJson()).toList();
	}
	return data;
}

companyDynamicContentEntityFromJson(CompanyDynamicContentEntity data, Map<String, dynamic> json) {
	if (json['date'] != null) {
		data.date = json['date'].toString();
	}
	if (json['content'] != null) {
		data.content = new List<CompanyDynamicInfoEntity>();
		(json['content'] as List).forEach((v) {
			data.content.add(new CompanyDynamicInfoEntity().fromJson(v));
		});
	}
	return data;
}

Map<String, dynamic> companyDynamicContentEntityToJson(CompanyDynamicContentEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['date'] = entity.date;
	if (entity.content != null) {
		data['content'] =  entity.content.map((v) => v.toJson()).toList();
	}
	return data;
}

companyDynamicInfoEntityFromJson(CompanyDynamicInfoEntity data, Map<String, dynamic> json) {
	if (json['bgh'] != null) {
		data.bgh = json['bgh'].toString();
	}
	if (json['bgsx'] != null) {
		data.bgsx = json['bgsx'].toString();
	}
	if (json['bgq'] != null) {
		data.bgq = json['bgq'].toString();
	}
	return data;
}

Map<String, dynamic> companyDynamicInfoEntityToJson(CompanyDynamicInfoEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['bgh'] = entity.bgh;
	data['bgsx'] = entity.bgsx;
	data['bgq'] = entity.bgq;
	return data;
}